tests = r"""

############################################################
##################### CNProvinceSelect #####################
############################################################
>>> from django.contrib.localflavor.cn.forms import CNProvinceSelect
>>> s = CNProvinceSelect()
>>> s.render('provinces', 'Hubei')
u'<select name="provinces">
    <option value="Anhui">\u5b89\u5fbd</option>
    <option value="Beijing">\u5317\u4eac</option>
    <option value="Chongqing">\u91cd\u5e86</option>
    <option value="Fujian">\u798f\u5efa</option>
    <option value="Gansu">\u7518\u8083</option>
    <option value="Guangdong">\u5e7f\u4e1c</option>
    <option value="Guangxi">\u5e7f\u897f\u58ee\u65cf\u81ea\u6cbb\u533a</option>
    <option value="Guizhou">\u8d35\u5dde</option>
    <option value="Hainan">\u6d77\u5357</option>
    <option value="Hebei">\u6cb3\u5317</option>
    <option value="Heilongjiang">\u9ed1\u9f99\u6c5f</option>
    <option value="Henan">\u6cb3\u5357</option>
    <option value="Hong Kong">\u9999\u6e2f</option>
    <option value="Hubei" selected="selected">\u6e56\u5317</option>
    <option value="Hunan">\u6e56\u5357</option>
    <option value="Jiangsu">\u6c5f\u82cf</option>
    <option value="Jiangxi">\u6c5f\u897f</option>
    <option value="Jilin">\u5409\u6797</option>
    <option value="Liaoning">\u8fbd\u5b81</option>
    <option value="Macao">\u6fb3\u95e8</option>
    <option value="Nei Mongol">\u5185\u8499\u53e4\u81ea\u6cbb\u533a</option>
    <option value="Ningxia">\u5b81\u590f\u56de\u65cf\u81ea\u6cbb\u533a</option>
    <option value="Qinghai">\u9752\u6d77</option>
    <option value="Shaanxi">\u9655\u897f</option>
    <option value="Shandong">\u5c71\u4e1c</option>
    <option value="Shanghai">\u4e0a\u6d77</option>
    <option value="Shanxi">\u5c71\u897f</option>
    <option value="Sichuan">\u56db\u5ddd</option>
    <option value="Taiwan">\u53f0\u6e7e</option>
    <option value="Tianjin">\u5929\u6d25</option>
    <option value="Xinjiang">\u65b0\u7586\u7ef4\u543e\u5c14\u81ea\u6cbb\u533a</option>
    <option value="Xizang">\u897f\u85cf\u81ea\u6cbb\u533a</option>
    <option value="Yunnan">\u4e91\u5357</option>
    <option value="Zhejiang">\u6d59\u6c5f</option>
</select>'

############################################################
##################### CNPostCodeField ######################
############################################################
>>> from django.contrib.localflavor.cn.forms import CNPostCodeField
>>> f = CNPostCodeField(required=False)
>>> f.clean('')
u''
>>> f.clean('091209')
u'091209'
>>> f.clean('09120')
Traceback (most recent call last):
    ...
ValidationError: [u'Enter a post code in the format XXXXXX.']
>>> f.clean('09120916')
Traceback (most recent call last):
    ...
ValidationError: [u'Enter a post code in the format XXXXXX.']

############################################################
##################### CNIDCardField ########################
############################################################
>>> from django.contrib.localflavor.cn.forms import CNIDCardField
>>> f = CNIDCardField(required=False)
>>> f.clean('')
u''

>>> # A string of 16 characters.
>>> f.clean("abcdefghijklmnop")
Traceback (most recent call last):
    ...
ValidationError: [u'ID Card Number consists of 15 or 18 digits.']

>>> # A string of 16 digits.
>>> f.clean("1010101010101010")
Traceback (most recent call last):
    ...
ValidationError: [u'ID Card Number consists of 15 or 18 digits.']

>>> # A valid 1st generation ID Card number.
>>> f.clean('110101491001001')
u'110101491001001'

>>> # A 1st generation ID Card number with invalid location
>>> f.clean('010101491001001')  # 01, an invalid location.
Traceback (most recent call last):
...
ValidationError: [u'Invalid ID Card Number: Wrong location code']

>>> # A 1st generation ID Card number with invalid birthdate.
>>> f.clean('110101491041001')  # 491041, an invalid day, 41
Traceback (most recent call last):
...
ValidationError: [u'Invalid ID Card Number: Wrong birthdate']

>>> # A valid 2nd generation ID Card number.
>>> f.clean('11010119491001001X')
u'11010119491001001X'

>>> # Another valid 2nd generation ID Card number, notice that the case of the last
>>> # character is changed.
>>> f.clean('11010119491001001x')
u'11010119491001001X'
>>> # An invalid 2nd generation ID Card number.
>>> f.clean('92010119491001001X')   # 92 is an invalid location code.
Traceback (most recent call last):
...
ValidationError: [u'Invalid ID Card Number: Wrong location code']

>>> # Another invalid 2nd generation ID Card number.
>>> f.clean('91010119491301001X')   # 19491301 is an invalid date.
Traceback (most recent call last):
...
ValidationError: [u'Invalid ID Card Number: Wrong birthdate']

>>> # Yet another invalid 2nd generation ID Card number.
>>> f.clean('910101194910010014')
Traceback (most recent call last):
...
ValidationError: [u'Invalid ID Card Number: Wrong checksum']

############################################################
##################### CNPhoneNumberField ###################
############################################################
>>> from django.contrib.localflavor.cn.forms import CNPhoneNumberField
>>> f = CNPhoneNumberField(required=False)
>>> f.clean('')
u''
>>> f.clean('010-12345678')
u'010-12345678'
>>> f.clean('010-1234567')
u'010-1234567'
>>> f.clean('0101-12345678')
u'0101-12345678'
>>> f.clean('0101-1234567')
u'0101-1234567'
>>> f.clean('01x-12345678')
Traceback (most recent call last):
...
ValidationError: [u'Enter a valid phone number.']
>>> f.clean('01123-12345678')
Traceback (most recent call last):
...
ValidationError: [u'Enter a valid phone number.']
>>> f.clean('010-123456789')
Traceback (most recent call last):
...
ValidationError: [u'Enter a valid phone number.']
>>> f.clean('010-12345678-020')
u'010-12345678-020'
>>> f.clean('010-12345678-')
Traceback (most recent call last):
...
ValidationError: [u'Enter a valid phone number.']

############################################################
##################### CNCellNumberField ####################
############################################################
>>> from django.contrib.localflavor.cn.forms import CNCellNumberField
>>> f = CNCellNumberField(required=False)
>>> f.clean('')
u''
>>> f.clean('13012345678')
u'13012345678'
>>> f.clean('130123456789')
Traceback (most recent call last):
...
ValidationError: [u'Enter a valid cell number.']
>>> f.clean('14012345678')
Traceback (most recent call last):
...
ValidationError: [u'Enter a valid cell number.']
"""
